namespace QMVnSoft.ReportForms
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormKTH04BViewer : FormReportViewer
    {
        private IContainer components;
        private LabelControl lblNgay_Ct1;
        private LabelControl lblNgay_Ct2;
        private LabelControl lblNo_Co;
        private LabelControl lblTk_List;
        private TextDate txtNgay_Ct1;
        private TextDate txtNgay_Ct2;
        private TextOption txtNo_Co;
        private LabelControl txtNo_Co0;
        private TextControl txtTk_List;

        public FormKTH04BViewer()
        {
            this.InitializeComponent();
            this.txtNgay_Ct1.Value = AppInstance.StartWorkingDate;
            this.txtNgay_Ct2.Value = AppInstance.EndWorkingDate;
            this.txtTk_List.Value = "1521,1522,1523,1524,1525,1527,153";
            this.txtNo_Co.Value = "C";
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormKTH04BViewer));
            this.txtNgay_Ct2 = new TextDate();
            this.lblNgay_Ct2 = new LabelControl();
            this.txtNgay_Ct1 = new TextDate();
            this.lblNgay_Ct1 = new LabelControl();
            this.txtNo_Co0 = new LabelControl();
            this.txtNo_Co = new TextOption();
            this.lblNo_Co = new LabelControl();
            this.txtTk_List = new TextControl();
            this.lblTk_List = new LabelControl();
            base.rptContainer.Panel1.SuspendLayout();
            base.rptContainer.SuspendLayout();
            base.SuspendLayout();
            base.rptContainer.Panel1.Controls.Add(this.txtTk_List);
            base.rptContainer.Panel1.Controls.Add(this.txtNo_Co0);
            base.rptContainer.Panel1.Controls.Add(this.txtNo_Co);
            base.rptContainer.Panel1.Controls.Add(this.lblTk_List);
            base.rptContainer.Panel1.Controls.Add(this.lblNo_Co);
            base.rptContainer.Panel1.Controls.Add(this.txtNgay_Ct2);
            base.rptContainer.Panel1.Controls.Add(this.lblNgay_Ct2);
            base.rptContainer.Panel1.Controls.Add(this.txtNgay_Ct1);
            base.rptContainer.Panel1.Controls.Add(this.lblNgay_Ct1);
            base.rptContainer.SplitterDistance = 0x43;
            this.txtNgay_Ct2.DateTimeFormat = TextDate.DateTimeFormatType.Date;
            this.txtNgay_Ct2.Font = new Font("Arial", 8.25f);
            this.txtNgay_Ct2.InsertKeyMode = InsertKeyMode.Overwrite;
            this.txtNgay_Ct2.Location = new Point(0x13c, 0x2d);
            this.txtNgay_Ct2.Mask = "00/00/0000";
            this.txtNgay_Ct2.Name = "txtNgay_Ct2";
            this.txtNgay_Ct2.OldValue = null;
            this.txtNgay_Ct2.Size = new Size(100, 20);
            this.txtNgay_Ct2.TabIndex = 3;
//            this.txtNgay_Ct2.Value = null;//manager.GetObject("txtNgay_Ct2.Value");
            this.lblNgay_Ct2.AutoSize = true;
            this.lblNgay_Ct2.Font = new Font("Arial", 8.25f);
            this.lblNgay_Ct2.Location = new Point(0x100, 0x30);
            this.lblNgay_Ct2.Name = "lblNgay_Ct2";
            this.lblNgay_Ct2.Size = new Size(0x36, 14);
            this.lblNgay_Ct2.TabIndex = 0x61;
            this.lblNgay_Ct2.Text = "Đến ngày";
            this.txtNgay_Ct1.DateTimeFormat = TextDate.DateTimeFormatType.Date;
            this.txtNgay_Ct1.Font = new Font("Arial", 8.25f);
            this.txtNgay_Ct1.InsertKeyMode = InsertKeyMode.Overwrite;
            this.txtNgay_Ct1.Location = new Point(0x6c, 0x2d);
            this.txtNgay_Ct1.Mask = "00/00/0000";
            this.txtNgay_Ct1.Name = "txtNgay_Ct1";
            this.txtNgay_Ct1.OldValue = null;
            this.txtNgay_Ct1.Size = new Size(100, 20);
            this.txtNgay_Ct1.TabIndex = 2;
//            this.txtNgay_Ct1.Value = null;//manager.GetObject("txtNgay_Ct1.Value");
            this.lblNgay_Ct1.AutoSize = true;
            this.lblNgay_Ct1.Font = new Font("Arial", 8.25f);
            this.lblNgay_Ct1.Location = new Point(12, 0x30);
            this.lblNgay_Ct1.Name = "lblNgay_Ct1";
            this.lblNgay_Ct1.Size = new Size(0x2f, 14);
            this.lblNgay_Ct1.TabIndex = 0x62;
            this.lblNgay_Ct1.Text = "Từ ngày";
            this.txtNo_Co0.AutoSize = true;
            this.txtNo_Co0.Font = new Font("Arial", 8.25f);
            this.txtNo_Co0.ForeColor = Color.Blue;
            this.txtNo_Co0.Location = new Point(0x88, 0x1b);
            this.txtNo_Co0.Name = "txtNo_Co0";
            this.txtNo_Co0.Size = new Size(0x3e, 14);
            this.txtNo_Co0.TabIndex = 0x72;
            this.txtNo_Co0.Text = "N-Nợ, C-C\x00f3";
            this.txtNo_Co.CharacterCasing = CharacterCasing.Upper;
            this.txtNo_Co.CheckTextSearched = false;
            this.txtNo_Co.DisabledForeColor = Color.Blue;
            this.txtNo_Co.Font = new Font("Arial", 8.25f);
            this.txtNo_Co.InputMask = "N,C";
            this.txtNo_Co.Location = new Point(0x6c, 0x18);
            this.txtNo_Co.Name = "txtNo_Co";
            this.txtNo_Co.OldValue = null;
            this.txtNo_Co.Size = new Size(0x16, 20);
            this.txtNo_Co.TabIndex = 1;
            this.txtNo_Co.Text = "N";
            this.txtNo_Co.TextAlign = HorizontalAlignment.Center;
            this.txtNo_Co.Value = "N";
            this.lblNo_Co.AutoSize = true;
            this.lblNo_Co.Font = new Font("Arial", 8.25f);
            this.lblNo_Co.Location = new Point(12, 0x1b);
            this.lblNo_Co.Name = "lblNo_Co";
            this.lblNo_Co.Size = new Size(0x33, 14);
            this.lblNo_Co.TabIndex = 0x71;
            this.lblNo_Co.Text = "Phát sinh";
            this.txtTk_List.CharacterCasing = CharacterCasing.Upper;
            this.txtTk_List.CheckTextSearched = false;
            this.txtTk_List.DisabledForeColor = Color.Blue;
            this.txtTk_List.Font = new Font("Arial", 8.25f);
            this.txtTk_List.Location = new Point(0x6c, 3);
            this.txtTk_List.MaxLength = 0xfe;
            this.txtTk_List.Name = "txtTk_List";
            this.txtTk_List.OldValue = null;
            this.txtTk_List.Size = new Size(0x134, 20);
            this.txtTk_List.TabIndex = 0;
            this.txtTk_List.UserTextLength = AppInstance.TextControlLength.InvoiceDescription;
//            this.txtTk_List.Value = null;//manager.GetObject("txtTk_List.Value");
            this.lblTk_List.AutoSize = true;
            this.lblTk_List.Font = new Font("Arial", 8.25f);
            this.lblTk_List.Location = new Point(12, 6);
            this.lblTk_List.Name = "lblTk_List";
            this.lblTk_List.Size = new Size(0x35, 14);
            this.lblTk_List.TabIndex = 0x71;
            this.lblTk_List.Text = "Tài khoản";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.CheckDetailMost = true;
            base.ClientSize = new Size(0x31a, 0x1cf);
            base.CrossTabReport = true;
            base.Name = "FormKTH04BViewer";
            base.rptContainer.Panel1.ResumeLayout(false);
            base.rptContainer.Panel1.PerformLayout();
            base.rptContainer.ResumeLayout(false);
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        protected override void OnMakeReport()
        {
            AppInstance.StartWorkingDate = (DateTime) this.txtNgay_Ct1.Value;
            AppInstance.EndWorkingDate = (DateTime) this.txtNgay_Ct2.Value;
            base.LocalTable = new ReportDataAccess().KTH04_Get(AppInstance.Subsidiaries, this.txtNgay_Ct1.Value, this.txtNgay_Ct2.Value, this.txtTk_List.Value, this.txtNo_Co.Value, AppInstance.DefLanguage);
            base.OnMakeReport();
        }

        protected override void OnSendParameters()
        {
            base.StimulReport["Ngay"] = "Từ ngày " + string.Format("{0:dd/MM/yyyy}", this.txtNgay_Ct1.Value) + " đến ngày " + string.Format("{0:dd/MM/yyyy}", this.txtNgay_Ct2.Value);
        }
    }
}

